package com.twxm.breed.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsAutoIncrement;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
/*
溶氧事件
 */

@Data
@Table(name = "event")
public class EventLog {

    @IsKey
    @IsAutoIncrement
    private int eventId;

    @Column(name = "pond_id",type = MySqlTypeConstant.VARCHAR,comment = "鱼塘ID",length = 255)
    private FishPond pond;

    @Column(comment = "报警时间",type = MySqlTypeConstant.DATETIME)
    private Date alarmTime;

    @Column(comment = "溶氧上限")
    private float upper;

    @Column(comment = "溶氧下限")
    private float lower;

    @Column(comment = "溶氧值")
    private float oxygen;

    public EventLog(FishPond pond, Date alarmTime, float upper, float lower, float oxygen) {
        this.pond = pond;
        this.alarmTime = alarmTime;
        this.upper = upper;
        this.lower = lower;
        this.oxygen = oxygen;
    }
}
